package com.soft.entity;

import java.time.LocalDate;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 实体：工作日志（表 worklog）
 * 描述：按天记录工作内容，关联创建者、可选所属团队与关联日程。
 */
@TableName("worklog")
public class Worklog {
    @TableId(value = "worklog_id", type = IdType.AUTO)
    private Integer worklogId;

    // 标题
    @TableField("title")
    private String title;

    // 内容
    @TableField("content")
    private String content;

    @JsonFormat(pattern = "yyyy-MM-dd")
    // 日志日期（仅日期）
    @TableField("log_date")
    private LocalDate logDate;

    // 创建者用户 ID
    @TableField("creator_id")
    private Integer creatorId;

    // 关联日程 ID（可空）
    @TableField("related_schedule_id")
    private Integer relatedScheduleId;

    // 所属团队 ID（可空）
    @TableField("related_team_id")
    private Integer relatedTeamId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    // 创建时间
    @TableField("create_time")
    private LocalDateTime createTime;

    public Integer getWorklogId() {
        return worklogId;
    }

    public void setWorklogId(Integer worklogId) {
        this.worklogId = worklogId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDate getLogDate() {
        return logDate;
    }

    public void setLogDate(LocalDate logDate) {
        this.logDate = logDate;
    }

    public Integer getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(Integer creatorId) {
        this.creatorId = creatorId;
    }

    public Integer getRelatedScheduleId() {
        return relatedScheduleId;
    }

    public void setRelatedScheduleId(Integer relatedScheduleId) {
        this.relatedScheduleId = relatedScheduleId;
    }

    public Integer getRelatedTeamId() {
        return relatedTeamId;
    }

    public void setRelatedTeamId(Integer relatedTeamId) {
        this.relatedTeamId = relatedTeamId;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
}
